


import { Table } from 'antd';
import CapitalModal from './CapitalModal';
import ReturnModal from './ReturnModal';
const dataSource = [
    {
        key: '1',
        bianhao: '胡彦斌',
        xiaoshouleixing: '箱',
        jineheji: 60,
        chuangjianriqi: '瓶',
        kehuleixing: 3,
        kehumingcheng: '222',
        yewuyuan:'小李',
        chukucangku:'2号仓库',
        peisongcheliang:'摩托',
        zhuangtai:'未付款',
    },
    {
        key: '2',
        bianhao: '许嵩',
        xiaoshouleixing: '箱',
        jineheji: 60,
        chuangjianriqi: '瓶',
        kehuleixing: 3,
        kehumingcheng: '222',
        yewuyuan:'小李',
        chukucangku:'2号仓库',
        peisongcheliang:'单车',
        zhuangtai:'已收货',
    },
];

const columns = [
    {
        title: '编号',
        dataIndex: 'bianhao',
        key: 'bianhao',
        // width: 60,
    },
    {
        title: '销售类型',
        dataIndex: 'xiaoshouleixing',
        key: 'xiaoshouleixing',
        // width: 60,
    },
    {
        title: '金额合计',
        dataIndex: 'jineheji',
        key: 'jineheji',
        // width: 60,
    },
    {
        title: '创建日期',
        dataIndex: 'chuangjianriqi',
        key: 'chuangjianriqi',
        // width: 60,
    },

    {
        title: '客户类型',
        dataIndex: 'kehuleixing',
        key: 'kehuleixing',
        // width: 60,
    },
    {
        title: '客户名称',
        dataIndex: 'kehumingcheng',
        key: 'kehumingcheng',
        // width: 60,
    },
    {
        title: '业务员',
        dataIndex: 'yewuyuan',
        key: 'yewuyuan',
        // width: 60,
        
    },
    {
        title: '出库仓库',
        dataIndex: 'chukucangku',
        key: 'chukucangku',
        // width: 60,
    },
    {
        title: '配送车辆',
        dataIndex: 'peisongcheliang',
        key: 'peisongcheliang',
        // width: 60,
    },
    {
        title: '状态',
        dataIndex: 'zhuangtai',
        key: 'zhuangtai',
        // width: 60,
    },
    {
        title: '操作',
        dataIndex: 'caozuo',
        key: '3',
        // width: 60,
        render: (text, record) => {
           switch(record.zhuangtai){
            case'未付款':return <> <CapitalModal text='确认收款' data = {record} /><ReturnModal text='退货' data = {record} /></>;
            case'未发货':return <> <CapitalModal text='确认发货' data = {record} /><ReturnModal text='退货' data = {record} /></>;
            case'待收货':return <> <CapitalModal text='确认收货' data = {record} /><ReturnModal text='退货' data = {record} /></>;
            case'已收货':return  <CapitalModal text='删除' data = {record} />;
            default:break;
           }
        }
    }, 
];
const OrderListTab = () => {
    return (
        <>
            <Table bordered ellipsis dataSource={dataSource} columns={columns} />  
        </>
    )


}


export default OrderListTab;